package pers.sen.health.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import pers.sen.health.po.User;
import pers.sen.health.vo.RoleVO;
import pers.sen.health.vo.UserVO;

import java.util.Set;

/**
 * @author Jason
 * @version 1.0.0
 * @date 2020/11/13 22:05
 * @Description TODO
 */

public interface UserMapper extends BaseMapper<User> {

    @Select("select ID,USERNAME,PASSWORD from t_user where USERNAME=#{username}")
    UserVO findUserInfoByUsername(@Param("username") String username);

    @Select("select tr.ID,tr.KEYWORD from t_user_role tur,t_role tr where tr.ID = tur.ROLE_ID and tur.USER_ID = #{id}")
    Set<RoleVO> findRoleInfoByUId(@Param("id") Integer id);
}
